import { request } from "@/utils/http";

export const loginAPI = (data) => {
  return request({ url: '/login/wxMin', method: 'POST', data })
};

export const loginTestAPI = (phoneNumber) => {
  return request({
    url: '/login/wxMin/simple',
    method: 'POST',
    data: {
      phoneNumber
    }
  })
};


/** 获取个人资料 */
export const getProfileAPI = () => {
  return request({ url: "/member/profile" });
};

// 1. 
export const updatePhotoAPI = (filePath) => {
  // 💥 上传文件调用的uni.uploadFile
  return uni.uploadFile({
    // 💥 不需要指定method
    url: '/member/profile/avatar',
    name: 'file',
    filePath
  })
};


export const updateProfileAPI = (data) => {
  return request({ url: "/member/profile", method: "put", data });
};
